Properties and methods of the document object

The following table lists the new properties and methods of the document object in Dreamweaver, along with their return values (with explanations, where appropriate). A bullet (·) marks read-only properties.

Property or method Return value and explanation

nodeType ·

Node.DOCUMENT_NODE

parentNode ·

null

parentWindow ·

The JavaScript object corresponding to the document's parent window. (This property is not included in DOM Level 1; however, it is supported by IE 4.0.)

childNodes ·

A nodelist containing all the immediate children of the document object. Typically the document will have a single child: the HTML object.

documentElement ·

The JavaScript object corresponding to the HTML tag. This property is shorthand for getting the value of document.childNodes and extracting the HTML tag from the nodelist.

body ·

The JavaScript object corresponding to the BODY tag. This property is shorthand for calling document.documentElement.childNodes and extracting the BODY tag from the nodelist. For frameset documents, this property returns the node for the outermost frameset instead.

URL ·

The file:// URL for the document or, if the file has not been saved, an empty string.

getElementsByTagName(tagName)

A nodelist that can be used to step through tags of type tagName (for example, IMG, DIV, and so on). Provides similar functionality to the dreamweaver.getObjectTags() function.

If the tag argument is LAYER, the function returns all LAYER and ILAYER tags and all absolutely positioned DIV and SPAN tags.

If the tag argument is INPUT, the function returns all form elements. (For this shortcut to work properly, all form field names must begin with a letter.)

hasChildNodes()

TRUE